﻿using System;
using System.Collections;
using System.Text;

namespace Petra.Gis.Geometry.Image.Tiff
{
  public partial class ImageFileDirectory
  {

    internal void checkStripOffsets(Tag tag)
    {
      if (tag.Count < 1)
      {
        throw new InvalidFileStructureException("Need at least one strip offset.");
      }
      if (tag.Count == 1)
      {
        if (!tag.isInt())
        {
          throw new InvalidFileStructureException("There is " +
            "only one strip offset, but its type is not integer.");
        }
      }
    }

    internal void checkStripByteCounts(Tag tag)
    {
      if (tag.Count < 1)
      {
        throw new InvalidFileStructureException("Need at least one strip offset.");
      }
      if (tag.Count == 1)
      {
        if (!tag.isInt())
        {
          throw new InvalidFileStructureException("There is " +
            "only one strip offset, but its type is not integer.");
        }
      }
    }
  }
}
